/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package cognitivetouch.colorSpan;

/**
 *
 * @author Xiaoxing
 */
public class Session {

    private final int trialPerSession;
    private int currentTrial;
    private Trial t;
    private final Judge judge;

    public Session(int n, Judge j) {
        trialPerSession = n;
        currentTrial = 0;
        judge = j;
        t = new Trial(j);
    }

    public boolean executeToFinish() {

        if (t.executeToFinish()) {
            currentTrial++;
            if (currentTrial < trialPerSession) {
                t = new Trial(judge);
            } else {
                return true;
            }
        }
        return false;
    }
}
